package com.tzy.webflux.controller;
import com.tzy.common.constant.WebResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
@RestController
@RequestMapping("/webflux")
public class WebfluxController {
    @GetMapping("/test/{id}")
    public Mono<WebResult> test(@PathVariable("id") Integer id, ServerWebExchange exchange){
        WebResult webResult = new WebResult();
        webResult.setCode(id);
        webResult.setMsg(id+"sdaafd");
        webResult.getResult().put("test","sdfdsaf");
        return Mono.just(webResult);
    }


}
